package pers.byxiaobai.levelhealth.utils;

import org.bukkit.entity.Player;

import pers.byxiaobai.levelhealth.group.Group;
import pers.byxiaobai.levelhealth.group.GroupManager;

/** 
* @author byxiaobai
* 类说明 
*/
public class PlayerHealthUtil {
	@SuppressWarnings("deprecation")
	public static void setPlayerMaxHealth(Player player,double value) {
		Group group=GroupManager.INSTANCE.getGroup(player);
		if(group!=null) {
			double maxValue=group.getMaxHealth();
			if(value>maxValue)value=maxValue;
		}
		player.setMaxHealth(value);
	}
	@SuppressWarnings("deprecation")
	public static double getPlayerMaxHealth(Player player) {
		return player.getMaxHealth();
	}
	
	public static void setPlayerHealthScale(Player player,double healthScale) {
		player.setHealthScale(healthScale);
	}
	
}
